<%@page trimDirectiveWhitespaces="true"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<div class="leftArea">
 <a href="?lang=en"><img src="${staticsUrl}/images/flags/us.png" /></a> <a href="?lang=fr"><img
  src="${staticsUrl}/images/flags/fr.png" /></a>
</div>
<sec:authorize access="isAuthenticated()">
 <div class="leftArea">
  <div id="username">
   <img src="${staticsUrl}/images/topbar/settings_off.png" />&nbsp;<a href="#"><sec:authentication
     property="principal.username" /></a>
  </div>
  <div id="settings_list">
   <spring:url value="/j_spring_security_logout" var="logoutUrl" />
   <spring:url value="/do/settings/password" var="passwordChangeUrl" />
   <spring:url value="/do/settings/address" var="addressChangeUrl" />
   <ul>
    <li><a href="${passwordChangeUrl}"> <spring:message code="label.change.password" /></a></li>
    <li><a href="${addressChangeUrl}"> <spring:message code="label.change.address" /></a></li>
    <li><a href="${logoutUrl}"> <spring:message code="label.logout" /></a></li>
   </ul>
  </div>
 </div>
</sec:authorize>
<sec:authorize access="isAnonymous()">
 <div class="leftArea">
  <div id="register">
   <img src="${staticsUrl}/images/topbar/settings_off.png" />&nbsp;<a href="#"><spring:message
     code="register.label" /></a>
  </div>
  <div id="register_list">
   <spring:url value="/do/register/patient" var="registerPatientUrl" />
   <spring:url value="/do/register/professional" var="registerProfessionalUrl" />
   <spring:url value="/do/register/lost" var="registerLostUrl" />
   <ul>
    <li><a href="${registerPatientUrl}"><spring:message code="label.register.patient" /></a></li>
    <li><a href="${registerProfessionalUrl}"><spring:message
       code="label.register.professional" /></a></li>
    <li><a href="${registerLostUrl}"><spring:message code="label.register.lost" /></a></li>
   </ul>
  </div>
 </div>
 <spring:url value="/j_spring_security_check" var="formActionUrl" />
 <form name='f' action="${formActionUrl}" method='POST'>
  <div class="rightArea">
   <input name="submit" type="submit" value="Login" class="login_button" tabindex="4" />
  </div>
  <div class="rightArea littleMarginRight">
   <label for="_spring_security_remember_me"><spring:message code="label.remember.me" /></label>
  </div>
  <div class="rightArea">
   <input type='checkbox' id='_spring_security_remember_me' name='_spring_security_remember_me'
    class="topbar" tabindex="3" />
  </div>
  <div class="rightArea">
   <input type='password' id='j_password' name='j_password' class="topbar" tabindex="2" />
  </div>
  <div class="rightArea">
   <label for="j_password"><spring:message code="label.password" /></label>
  </div>
  <div class="rightArea">
   <input type='text' id='j_username' name='j_username' value='' class="topbar" tabindex="1" />
  </div>
  <div class="rightArea">
   <label for="j_username"><spring:message code="label.login" /></label>
  </div>
 </form>
</sec:authorize>
<div class="clear"></div>
